﻿<UserControl x:Class="KinectPlayer.SlideRight" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:KinectPlayer="clr-namespace:KinectPlayer" mc:Ignorable="d" d:DesignHeight="90" d:DesignWidth="90" Width="Auto" Height="Auto">
	<UserControl.Resources>

		<KinectPlayer:MirrorRenderTransformConverter x:Key="mirror" />

		<Style x:Key="HorizontalHandSliderThumbStyle" TargetType="{x:Type Thumb}">
			<Setter Property="Focusable" Value="false" />
			<Setter Property="OverridesDefaultStyle" Value="true" />
			<Setter Property="Height" Value="22" />
			<Setter Property="Width" Value="11" />
			<Setter Property="Foreground" Value="Gray" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Canvas Height="54" Width="54" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="1">
							<Ellipse Width="54" Height="54" Stretch="Fill" StrokeThickness="2.72727" StrokeLineJoin="Round" Stroke="#FFFFFFFF" Fill="#FFE77F0F" />
							<Path Width="32" Height="35" Canvas.Left="10" Canvas.Top="9" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 42.7119,19.7392C 43.021,18.3919 42.2855,17.0773 41.0781,16.8185C 39.8716,16.5597 38.5868,17.4381 38.2241,18.7721L 36.338,25.7017C 36.109,25.4946 35.8696,25.2986 35.6216,25.1131L 36.8721,13.6385C 37.0228,12.2645 36.1392,11.0476 34.9102,10.9339C 33.6805,10.8203 32.5187,11.8468 32.3282,13.2165L 30.9272,23.2766C 30.7911,23.2624 30.6515,23.2624 30.5138,23.2542L 29.7896,12.0358C 29.7001,10.657 28.621,9.60852 27.3911,9.70587C 26.1595,9.80402 25.1656,11.0149 25.1813,12.3975L 25.3156,24.4263C 25.1934,24.4934 25.078,24.5696 24.96,24.6424L 23.0223,14.9501C 22.751,13.595 21.5419,12.6994 20.3345,12.9603C 19.1279,13.2204 18.3029,14.5531 18.501,15.9207L 20.6385,30.6605C 20.6246,30.7225 20.604,30.7819 20.5909,30.8447L 14.6031,25.6328C 13.3009,24.5004 11.5304,24.4216 10.6675,25.4579C 9.80627,26.4953 10.0526,28.3865 11.2159,29.6614L 22.5812,42.1088L 22.583,42.0975C 24.3105,43.8173 26.6884,44.8818 29.3159,44.8818C 33.7476,44.8818 37.4637,41.8521 38.5419,37.7507L 38.5712,37.8152L 39.1,35.5081C 39.2017,35.1619 39.2799,34.8072 39.3428,34.4467L 42.7119,19.7392 Z " RenderTransformOrigin="0.5,0.5" RenderTransform="{Binding IsRightHand, Converter={StaticResource mirror}}">
							</Path>
						</Canvas>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style x:Key="RightHandSliderStyle" TargetType="{x:Type Slider}">
			<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
			<Setter Property="Background" Value="Transparent" />
			<Setter Property="Foreground" Value="#FFC4C4C4" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Slider}">
						<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
							<Grid>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto" />
									<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}" />
									<RowDefinition Height="Auto" />
								</Grid.RowDefinitions>
								<Track x:Name="PART_Track" Grid.Row="1">
									<Track.DecreaseRepeatButton>
										<RepeatButton Visibility="Hidden" />
									</Track.DecreaseRepeatButton>
									<Track.IncreaseRepeatButton>
										<RepeatButton Visibility="Hidden" />
									</Track.IncreaseRepeatButton>
									<Track.Thumb>
										<Thumb x:Name="Thumb" Style="{StaticResource HorizontalHandSliderThumbStyle}" Width="54" Height="54" RenderTransformOrigin="0.5,0.5">
											<Thumb.RenderTransform>
												<ScaleTransform ScaleX="-1" />
											</Thumb.RenderTransform>
										</Thumb>
									</Track.Thumb>
								</Track>
							</Grid>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Storyboard x:Key="loading">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="rectangle">
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="270" />
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path">
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.4" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.6" Value="0" />
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path1">
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.4" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.6" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.8" Value="0" />
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path2">
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.1" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.7" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.9" Value="0" />
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="path3">
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.3" Value="0" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1" />
				<EasingDoubleKeyFrame KeyTime="0:0:1.7" Value="0" />
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="slider">
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>

	</UserControl.Resources>

	<Grid Margin="0,-90,-220,-90" Background="Transparent" RenderTransformOrigin="0.5,0.5">

		<Grid.RenderTransform>
			<TransformGroup>
				<ScaleTransform ScaleX="-1" />
				<SkewTransform />
				<RotateTransform />
				<TranslateTransform />
			</TransformGroup>
		</Grid.RenderTransform>
		<Rectangle x:Name="rectangle" Fill="#52FFFFFF" HorizontalAlignment="Right" RadiusY="24" RadiusX="24" Stroke="#FFFFFFFF" StrokeThickness="4" StrokeLineJoin="Round" Width="54" VerticalAlignment="Center" Height="54" Margin="0,0,18,0" Opacity="0" />
		<Canvas HorizontalAlignment="Left" Height="27.292" VerticalAlignment="Center" Width="143.384" Margin="40,0,0,0">
			<Path x:Name="path1" Width="23.1879" Height="27.2921" Canvas.Left="40.0653" Canvas.Top="0.000244141" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 54.5609,0.000244141L 40.0653,13.6778L 54.4978,27.2923L 63.1902,27.2923L 48.7576,13.6778L 63.2532,0.000244141L 54.5609,0.000244141 Z " Opacity="0" />
			<Path x:Name="path2" Width="23.1879" Height="27.2921" Canvas.Left="0" Canvas.Top="0.000244141" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 14.4955,0.000244141L 0,13.6778L 14.4325,27.2923L 23.1248,27.2923L 8.69226,13.6778L 23.1879,0.000244141L 14.4955,0.000244141 Z " Opacity="0" />
			<Path x:Name="path3" Width="23.1879" Height="27.292" Canvas.Left="80.1309" Canvas.Top="0.000183105" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 94.6263,0.000183105L 80.1309,13.6777L 94.5634,27.2922L 103.256,27.2922L 88.8231,13.6777L 103.319,0.000183105L 94.6263,0.000183105 Z " Opacity="0" />
			<Path x:Name="path" Width="23.1879" Height="27.2921" Canvas.Left="120.196" Canvas.Top="0" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 134.692,0L 120.196,13.6776L 134.629,27.2921L 143.321,27.2921L 128.889,13.6776L 143.384,0L 134.692,0 Z " Opacity="0" />
		</Canvas>
		<Slider HorizontalAlignment="Right" VerticalAlignment="Center" x:Name="slider" Style="{StaticResource RightHandSliderStyle}" Height="Auto" Margin="0,0,18,0" Width="270" RenderTransformOrigin="0.5,0.5" Value="{Binding OverPosition.X}" Maximum="1" Opacity="0">
			<Slider.RenderTransform>
				<ScaleTransform ScaleX="-1" />
			</Slider.RenderTransform>
		</Slider>

	</Grid>
</UserControl>